package com.cucn.ingmall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cucn.common.utils.PageUtils;
import com.cucn.ingmall.member.entity.MemberEntity;
import com.cucn.ingmall.member.exception.PhoneExistExcetion;
import com.cucn.ingmall.member.exception.UserNameExistException;
import com.cucn.ingmall.member.vo.MemberLoginVO;
import com.cucn.ingmall.member.vo.MemberRegistVO;
import com.cucn.ingmall.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员
 *
 * @author kouchaojie
 * @email kou1688@foxmail.com
 * @date 2021-11-17 18:26:50
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 用户注册功能
     *
     * @param registVO 注册基本信息
     */
    void regist(MemberRegistVO registVO);

    void checkEmailUnique(String email);

    void checkUserNameUnique(String userName) throws UserNameExistException;

    void checkPhoneUnique(String phone) throws PhoneExistExcetion;

    /**
     * 用户登录
     *
     * @param loginVO 登录vo
     * @return
     */
    MemberEntity login(MemberLoginVO loginVO);

    /**
     * 社交登录判断
     *
     * @param socialUser
     * @return
     */
    MemberEntity authLogin(SocialUser socialUser) throws Exception;
}

